package com.eagle.coders.security.beans;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;


/**
 * 
 * @author Anees
 *
 */
@Entity
@Table(name ="eagle_function")
@SequenceGenerator(name="function_gen_seq", sequenceName="eagle_gen_seq")
public class FunctionsBean implements Serializable{
	
	/**
	 * 
	 * @author Anees
	 *
	 */
	public enum FunctionType {
		
		GENERAL("1"), INTERBRANCH("2");
		
		private String string;
		
		private FunctionType(final String string){
			this.string = string;
		}
		
		public String getValue(){
			
			return this.string;
		}
	}
	
	/**
	 * 
	 * @author Anees
	 *
	 */
	public enum FunctionOverridingType {
		
		REQUIRED("Y"), NOTREQUIRED("N");
		
		private String string;
		
		private FunctionOverridingType(String string){
			this.string = string;
		}
		
		public String getValue(){
			return this.string;
		}
	}

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private Integer id;
	
	private String functionCode;
	
	private String moduleCode;
	
	private String functionName;
	
	private FunctionType functionType;
	
	private FunctionOverridingType functionOverridingType;

	/**
	 * @return the id
	 */
	@Id
	@GeneratedValue(generator="function_gen_seq", strategy=GenerationType.SEQUENCE)
	public Integer getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(Integer id) {
		this.id = id;
	}

	/**
	 * @return the functionCode
	 */
	@Column(name = "func_cd", length = 50, nullable = false)
	public String getFunctionCode() {
		return functionCode;
	}

	/**
	 * @param functionCode the functionCode to set
	 */
	public void setFunctionCode(String functionCode) {
		this.functionCode = functionCode;
	}

	/**
	 * @return the moduleCode
	 */
	@Column(name = "mod_cd", length = 50, nullable=false)
	public String getModuleCode() {
		return moduleCode;
	}

	/**
	 * @param moduleCode the moduleCode to set
	 */
	public void setModuleCode(String moduleCode) {
		this.moduleCode = moduleCode;
	}

	/**
	 * @return the functionName
	 */
	@Column(name = "func_name", length = 50)
	public String getFunctionName() {
		return functionName;
	}

	/**
	 * @param functionName the functionName to set
	 */
	public void setFunctionName(String functionName) {
		this.functionName = functionName;
	}

	/**
	 * @return the functionType
	 */
	@Column(name = "func_Type")
	@Enumerated(value = EnumType.STRING)
	public FunctionType getFunctionType() {
		return functionType;
	}

	/**
	 * @param functionType the functionType to set
	 */
	public void setFunctionType(FunctionType functionType) {
		this.functionType = functionType;
	}

	/**
	 * @return the functionOverridingType
	 */
	@Column(name = "overriding_Type")
	@Enumerated(value = EnumType.STRING)
	public FunctionOverridingType getFunctionOverridingType() {
		return functionOverridingType;
	}

	/**
	 * @param functionOverridingType the functionOverridingType to set
	 */
	public void setFunctionOverridingType(
			FunctionOverridingType functionOverridingType) {
		this.functionOverridingType = functionOverridingType;
	}
	
}
